package test.dxy;

import java.lang.Math;

public class PrimerNumber {
	public static void main(String args[]) {
		int n = 50;
		int sieve[] = new int[n + 1];
		int iCounter = 2, iMax, i;
		for (i = 1; i <= n; i++) {
			sieve[i] = i;
		}
		iMax = (int) Math.sqrt(n);
		while (iCounter <= iMax) {
			for (i = 2 * iCounter; i <= n; i += iCounter)
				sieve[i] = 0;
			iCounter++;
		}
		for (i = 1; i <= n; i++)
			if (sieve[i] != 0)
				System.out.println(sieve[i]);
	}
}
